<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue 组件props通信(子组件使用父组件数据)</title>
</head>
<style>
    .template {
        margin: 5% 10%;
    }
</style>
<body>
<div id="app">
    <div class="template">
        <html-component1 v-bind:param1="text" param2="第二个参数"></html-component1>
    </div>
</div>

<script src="../js/vue.js"></script>
<script>

    const message = {
        text: '请输入身份号',
    };


    const vue_child = {
        data() {
            return {
                message: 'vue_child局部组件'
            }
        },
        template: `
          <h4>
          这是=>{{ message }}
          <div>
            props的param1为==>{{ param1 }}
          </div>
          <div>
            props的param2为==>{{ param2 }}
          </div>
          </h4>
        `,
        props: ['param1', 'param2']
    }


    const demo = new Vue({
        el: '#app',
        data: message,
        methods: {},
        computed: {},
        components: {
            'html-component1': vue_child,
        }
    });
</script>
</body>
</html>